﻿/*----------------------------------------------------------------
// Copyright (C) 2011 上海
// 版权所有。 
//
// 文件名：ConyifuChongZhiInfo
// 文件功能描述：充值
//
// 
// 创建标识：2012-07-14 王冲
//
// 修改标识：
// 修改描述：
//
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAO.WaiGaoQiao;

namespace Model.WaiGaoQiao
{
    public class ConyifuChongZhiInfo
    {
        public int ID
        {
            get;
            set;
        }
        public string RDateTime
        {
            get;
            set;
        }
        public string deptname
        {
            get;
            set;
        }
        public string empno
        {
            get;
            set;
        }
        public string name
        {
            get;
            set;
        }
        public string conmoney
        {
            get;
            set;
        }
        public string balance
        {
            get;
            set;
        }
        public string OperatorID
        {
            get;
            set;
        }
        public string money
        {
            get;
            set;
        }
        public string balanceq
        {
            get;
            set;
        }

        private DataAccessConyifuChongZhi dar;
        public DataSet GetInfo(string select)
        {
            dar = new DataAccessConyifuChongZhi();
            return dar.GetInfo(select);
        }

        public IList<ConyifuChongZhiInfo> GetList(int pagesize, int startindex, string strDateTime)
        {
            dar = new DataAccessConyifuChongZhi();
            IList<ConyifuChongZhiInfo> funlist = new List<ConyifuChongZhiInfo>();
            ConyifuChongZhiInfo funinfo;
            DataSet ds = dar.GetList(pagesize, startindex, strDateTime);
            foreach (DataRow item in ds.Tables[0].Rows)
            {
                funinfo = new ConyifuChongZhiInfo()
                {
                    ID = Convert.ToInt32(item["Xiyi_ID"]),
                    RDateTime = item["RDateTime"].ToString(),
                    deptname = item["deptname"].ToString(),
                    empno = item["empno"].ToString(),
                    name = item["姓名"].ToString(),
                    conmoney = item["conmoney"].ToString(),
                    balance = item["balance"].ToString(),
                    balanceq = item["balanceq"].ToString()
                };
                funlist.Add(funinfo);
            }
            return funlist;
        }

        public int GetListCount(string strDateTime)
        {
            dar = new DataAccessConyifuChongZhi();
            return dar.GetListCount(strDateTime);
        }

        public int SaveIncreaseMoney(ConyifuChongZhiInfo fun)
        {
            object[] obj = new object[] { fun.empno, fun.money, fun.OperatorID };
            dar = new DataAccessConyifuChongZhi();
            return dar.SaveIncreaseMoney(obj);
        }
    }
}
